<!--- SUI模板 on 2017/3/30 -->
<script ng-init="initCss('hello-page/order.css');setTitle('派车单列表');init();nextDepartures();"></script>
<div class="page">
    <nav class="bar bar-tab">
        <a ng-if="user.userRole=='customer'||user.userRole=='customer_special'||user.userRole=='sales_manager'"
           class="tab-item external" href="#order">
            <span class="icon icon-home"></span>
            <span class="tab-label">工单</span>
        </a>
        <a ng-if="user.userRole=='worker'" class="tab-item active external" href="#task">
            <span class="icon icon-home"></span>
            <span class="tab-label">任务</span>
        </a>
        <a ng-if="user.userRole=='driver'" class="tab-item active external" href="#departure">
            <span class="icon icon-home"></span>
            <span class="tab-label">派车单</span>
        </a>
        <a class="tab-item external" href="#hello">
            <span class="icon icon-me"></span>
            <span class="tab-label">我</span>
        </a>
    </nav>
    <div class="content pull-to-refresh-content infinite-scroll departure-list-content" ng-init="">
        <div class="pull-to-refresh-layer my">
            <div class="preloader"></div>
            <div class="pull-to-refresh-arrow"></div>
        </div>
        <div class="content-block-title">您的派车单</div>
        <div class="list-block">
            <ul>
                <li class="item-content item-link"
                    ng-repeat="departure in departures track by departure.departureId"
                    ng-click="openDepartureDetail(departure)">
                    <div class="item-media"><i class="icon icon-f7"></i></div>
                    <div class="item-inner">
                        <div class="item-title">{{departure|getDepartureTitle}}</div>
                        <div class="item-after">{{departure|getDepartureStatus}}</div>
                    </div>
                </li>
            </ul>
            <!--加载提示符 -->
            <div class="infinite-scroll-preloader">
                <div class="preloader"></div>
                加载中...
            </div>
        </div>
    </div>
    <div class="popup popup-detail">
        <nav class="bar bar-tab bar-popup">
            <a ng-if="user.userRole=='driver'&&selectDeparture.departureStatus==0" class="tab-item external red-white"
               ng-click="receive(selectDeparture)" href="javascript:;">
                <span class="tab-label">确认接单</span>
            </a>
            <a ng-if="user.userRole=='driver'&&selectDeparture.departureStatus==3&&selectDeparture.departureCostTime-selectDeparture.departureRealCostTime<0" class="tab-item external origin-white"
               ng-click="resultOfOvertime(selectDeparture)" href="javascript:;">
                <span class="tab-label">填写超时原因</span>
            </a>
            <a class="close-popup tab-item external" href="javascript:;">
                <span class="tab-label">返回</span>
            </a>
        </nav>
        <div class="content-inner-box">
            <div class="content-block" ng-if="selectDeparture">
                <p>派车单详情</p>
                <p>状态：{{selectDeparture|getDepartureStatus}}</p>
                <p>派遣司机：{{selectDeparture.departureDriver.userRealName}}</p>
                <p>发车时间：{{selectDeparture.departureStartTime|date:'yyyy年MM月dd日 HH点mm分ss秒'}}</p>
                <p>目的地：{{selectDeparture.departureAimPlace}}</p>
                <p>首达客户：{{selectDeparture.departureFirstCustomerName}}</p>
                <p>转场：{{selectDeparture.departureTransition}}</p>
                <p>合计派车费：{{selectDeparture.departureCostMoneyDesc}}
                    合计（￥）：{{selectDeparture.departureCostMoney|number:2}}</p>
                <p>预计耗时：{{selectDeparture.departureCostTimeDesc}}
                    共（h）：{{selectDeparture.departureCostTime|number:2}}</p>
                <p>实际返回时间：{{selectDeparture.departureBackTime|date:'yyyy年MM月dd日 HH点mm分ss秒'}}</p>
                <p>派车人：{{selectDeparture.departureInitiator.userRealName}}</p>
                <p>回厂收货：{{selectDeparture.departureInitiator.departureReceiverName}}</p>
                <p>实际耗时（h）：{{selectDeparture.departureRealCostTime|number:2}}</p>
                <p>超时原因：{{selectDeparture.departureOvertimeResult}}</p>
            </div>
        </div>

    </div>
</div>
<div ng-init="suiMobileInit()"></div>